﻿@model WebDuLichDev.Models.ManagerUserRole
@{
   
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_pureLayout.cshtml";
}
<h3 style="color: #DC143C; font-size: 18px; background-color: #f9f9f9; margin-top: 0px;
    height: 40px; line-height: 2.1em; margin-bottom: 0px; width:600px">
        <img src="~/Content/themes/custom/Image/User-Manage.png" width="32" />
        <span>@Resources.Language.AssignUserTo</span> <b style="color:#DC143C"> @ViewBag.RoleName</b>
</h3>
<div id="bcgpanels">
    
    <div class="panels">
        <div style="height:430px;width: 260px; overflow-y: scroll;">
            @using (Html.BeginForm("AddUser", "Role", FormMethod.Post, new { id = "frmAddUser" }))
            {
                <input name="roleId" value="@ViewBag.RoleId" type="hidden"/>
                <table class="table table-striped table-bordered table-condensed">
                    <caption>User Not In Role</caption>
                    <tr>
                        <th>#</th>
                        <th>@Resources.Language.Username</th>
                    </tr>
                    @foreach (var item in Model.listUserProfileNotInRole)
                    {
                        <tr>
                            <td>
                                <input type="checkbox" name="UserID" value="@item.UserId"/></td>
                            <td>
                                <label>@item.UserName</label></td>
                        </tr>
                    }
                </table> 
            }
        </div>
    </div>
    <div id="commands">
        <div>
            <a href="#" id="btnAddUser">
                <img src="/Content/themes/custom/Image/Next-Light.png" alt="Add"
                    onmouseover="this.src='/Content/themes/custom/Image/Next-Dark.png';"
                    onmouseout="this.src='/Content/themes/custom/Image/Next-Light.png'" /></a>
        </div>
        <div>
            <a href="#" id="btnDelUser">
                <img src="/Content/themes/custom/Image/Back-Light.png" alt="Del"
                    onmouseover="this.src='/Content/themes/custom/Image/Back-Dark.png';"
                    onmouseout="this.src='/Content/themes/custom/Image/Back-Light.png'" /></a>
        </div>
    </div>
    <div class="panels">
        <div style="height:430px;width: 260px; overflow-y: scroll;">
            @using (Html.BeginForm("DelUser", "Role", FormMethod.Post, new { id = "frmDelUser" }))
            {
                <input name="roleId" value="@ViewBag.RoleId" type="hidden"/>
                <table class="table table-striped table-bordered table-condensed">
                    <caption>User In Role</caption>
                    <tr>
                        <th>#</th>
                        <th>@Resources.Language.Username</th>
                    </tr>
                    @foreach (var item in Model.listUserProfile)
                    {
                        <tr>
                            <td>
                                <input type="checkbox" name="UserID" value="@item.UserId"/></td>
                            <td>
                                <label>@item.UserName</label></td>
                        </tr>
                    }
                </table> 
            }
        </div>
    </div>
  
</div>
  <script type="text/javascript">
        $(document).ready(function () {

            $('#btnAddUser').click(function () {
                $('#frmAddUser').submit();
            });

            $('#btnDelUser').click(function () {

                $('#frmDelUser').submit();
            });
            //$("tr").click(function () {
            //    $(this).addClass("selected").siblings().removeClass("selected");
            //});
        });
    </script>